import request from '@/utils/request'

export function getList() {
  return request({
    url: '/emp/all',
    method: 'get'
  })
}

export function page(query) {
    return request({
        url: '/emp',
        method: 'get',
        params: query
    })
}

export function add(emp) {
    return request({
        url: '/emp',
        method: 'post',
        data: emp
    })
}

export function update(dept) {
    return request({
        url: '/emp',
        method: 'put',
        data: dept
    })
}

export function deleteById(id) {
    return request({
        url: '/emp/' + id,
        method: 'delete'
    })
}

export function exportExcel() {
  const config = {
    url: '/emp/export',
    method: 'get',
    responseType: 'blob' // 设置响应类型为blob，处理二进制数据
  };
  return request(config);
}
export function selectById(id) {
    return request({
        url: '/emp/byId/' + id,
        method: 'get'
    })
}

